package adv41;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Properties;

/**
 * @author oldliu
 * @since 1.0
 */
public class ClsTest {
    public static void main(String[] args) throws ClassNotFoundException {
        //Class<Integer> integerClass = int.class;
        //Class<ClsTest> c1 = ClsTest.class;
        Properties p=new Properties();
        Class<Properties> c0 = Properties.class;
        Class<? extends Properties> c2 = p.getClass();
        Class c3=Class.forName("java.util.Properties");
        System.out.println(c0==c2);
        System.out.println(c0==c3);
        System.out.println(">>>>>>>>>>>>>>>>");
        System.out.println(c0.getName());
        System.out.println("父类："+c0.getSuperclass().getName());
        Class<?>[] cr = c0.getInterfaces();
        System.out.println("接口："+Arrays.toString(cr));
        Field[] fr = c0.getDeclaredFields();
        System.out.println("所有的属性：");
        Method[] mr = c0.getDeclaredMethods();
        System.out.println("所有的方法：");
        Constructor<?>[] cons = c0.getDeclaredConstructors();
        System.out.println("所有的构造方法");
    }
}
